package Notepad;

public class Page {
	private String title = "";
	private String text = "";

	Page(String title){
		if(title == null){
			System.out.println("Wrong tittle format! Please reset the app!");
		}else
			this.title = title;
	}
	
	void addText(final String text) {
		if(text != null)
		this.text = this.text.concat(text);
		else 
			System.out.println("Wrong text input!");
	}

	void deleteText() {
		this.text = "";
	}

	String getPageInfo() {
		return this.title + "\n " + this.text;
	}
	public boolean equals(Object obj){
		if(obj != null && obj instanceof Page){
			return ((Page) obj).title.equals(this.title);
		}else
			return false;
	}
}
